#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926
#define   SQUARE(x) ((x)*(x))
//double SQUARE(double x) { return x*x;}

long long f[100]={1,1,2,3};

void w1()
{
	int a,b,n, k;
	scanf("%d%d",&n, &k);
	int cnt = 0;
	a = n;
	for(;a>0;){
		if( 3 == a % 10) cnt++;
		a /= 10;
	}
	printf("%s", cnt == k && 0 == n % 19 ? "YES" : "NO" );
}

int main()
{
	w1();
  return 0;
}
